Snapshot metadata arrangement for efficient cloud integrated data management

ABSTRACT

A storage appliance arranges snapshot data and snapshot metadata into different structures, and arranges the snapshot metadata to facilitate efficient snapshot manipulation, which may be for snapshot management or snapshot restore. The storage appliance receives snapshots according to a forever incremental configuration and arranges snapshot metadata into different types of records. The storage appliance stores these records in key-value stores maintained for each defined data collection (e.g., volume). The storage appliance arranges the snapshot metadata into records for inode information, records for directory information, and records that map source descriptors of data blocks to snapshot file descriptors. The storage appliance uses a locally generated snapshot identifier as a key prefix for the records to conform to a sort constrain of the key-value store, which allows the efficiency of the key-value store to be leveraged. The snapshot metadata arrangement facilitates efficient snapshot restore, file restore, and snapshot reclamation.

BACKGROUND

The disclosure generally relates to the field of data processing, andmore particularly to database and file management or data structures.

An organization can specify a data management strategy in a policy(ies)that involves data recovery and/or data retention. For data recovery, anapplication or program creates a backup and restores the backup whenneeded. The Storage Networking Industry Association (SNIA) defines abackup as a “collection of data stored on (usually removable)non-volatile storage media for purposes of recovery in case the originalcopy of data is lost or becomes inaccessible; also called a backupcopy.” For data retention, an application or program creates an archive.SNIA defines an archive as “A collection of data objects, perhaps withassociated metadata, in a storage system whose primary purpose is thelong-term preservation and retention of that data.” Although creating anarchive may involve additional operations (e.g., indexing to facilitatesearching, compressing, encrypting, etc.) and a backup can be writablewhile an archive may not be, the creation of both involves copying datafrom a source to a destination.

This copying to create a backup or an archive can be done differently.All of a defined set of data objects can be copied, regardless ofwhether they have been modified since the last backup to create a “fullbackup.” Backups can also be incremental. A system can limit copying tomodified objects to create incremental backups, either a cumulativeincremental backup or a differential incremental backup. SNIA defines adifferential incremental backup as “a backup in which data objectsmodified since the last full backup or incremental backup are copied.”SNIA defines a cumulative incremental backup as a “backup in which alldata objects modified since the last full backup are copied.”

A data management/protection strategy can use “snapshots,” which adds apoint in time aspect to a backup. A more specific definition of asnapshot is a “fully usable copy of a defined collection of data thatcontains an image of the data as it appeared at a single instant intime.” In other words, a snapshot can be considered a backup at aparticular time instant. Thus, the different techniques for creating abackup can include different techniques for creating a snapshot. TheSNIA definition further elaborates that a snapshot is “considered tohave logically occurred at that point in time, but implementations mayperform part or all of the copy at other times (e.g., via database logreplay or rollback) as long as the result is a consistent copy of thedata as it appeared at that point in time. Implementations may restrictpoint in time copies to be read-only or may permit subsequent writes tothe copy.”

An organization can use different backup strategies. A few backupstrategies include a “periodic full” backup strategy and a “foreverincremental” backup strategy. With the periodic full backup strategy, abackup application creates a full snapshot (“baseline snapshot”)periodically and creates incremental snapshots between the periodicallycreated full snapshots. With the forever incremental backup strategy, abackup application creates an initial snapshot that is a full snapshotand creates incremental snapshots thereafter.

Data management/protection strategies increasingly rely on cloud serviceproviders. A cloud service provider maintains equipment and softwarewithout burdening customers with the details. The cloud service providerprovides an application programming interface (API) to customers. TheAPI provides access to resources of the cloud service provider withoutvisibility of those resources.

BRIEF DESCRIPTION OF THE DRAWINGS

Embodiments of the disclosure may be better understood by referencingthe accompanying drawings.

FIG. 1 is a diagram of an example storage appliance that arrangessnapshot metadata into key-value stores for each defined data collectionfor which a snapshot is received.

FIG. 2 is a diagram of snapshot metadata in a key-value store maintainedat a storage appliance.

FIG. 3 is a flowchart of example operations for updating acloud-integrated appliance with a snapshot. FIGS. 4-6 are flowcharts ofexample operations for restoring a snapshot leveraging the efficientsnapshot layout.

FIGS. 4-6 are flowcharts of example operations for restoring a snapshotleveraging the efficient snapshot layout.

FIGS. 7-9 are flowcharts for example operations to restore a file usingthe efficient snapshot layout.

FIGS. 10-14 are flowcharts of example operations for snapshotreclamation. FIG. 10 is a flowchart of example operations for snapshotreclamation, while FIGS. 11-14 expand upon example operations withinFIG. 10.

FIG. 15 is a diagram of a cloud cache snapshot manager creating asynthetic baseline as part of reducing stable data eviction.

FIG. 16 is a flowchart of example operations for creating a syntheticbaseline snapshot with data ownership expansion.

FIGS. 17-20 depict a flowchart of example operations for creating areverse incremental based synthetic baseline snapshot to reduce stabledata eviction.

FIG. 21 depicts an example computer system with a storage appliancesnapshot manager.

DESCRIPTION

The description that follows includes example systems, methods,techniques, and program flows that embody embodiments of the disclosure.However, it is understood that this disclosure may be practiced withoutthese specific details. For instance, this disclosure refers to datablocks in illustrative examples. But data of a snapshot may be referredto as a data segments, data objects, data units, etc. In otherinstances, well-known instruction instances, protocols, structures andtechniques have not been shown in detail in order not to obfuscate thedescription.

Overview

A data management/protection strategy is carried out by a “solution”that includes one or more applications, which will be referred to hereinas a data management application. The data management application can behosted on a device that operates as an intermediary between a datasource(s) and cloud storage. A data management application that usessnapshots effectively has 2 phases: 1) creation of snapshots over time,and 2) restoring/activating a snapshot(s). A policy can define theparameters for creation of a snapshot for a defined data collection,such as periodic baseline snapshots versus forever incrementalsnapshots, the time period for a snapshot, and a number of snapshots toretain. If data is lost or corrupted, a data management application canrestore a particular snapshot corresponding to a particular timeinstant. To “activate” a snapshot, a data management application canchange a permission(s) of the defined data collection of a snapshot topermit writing and/or expose the data collection for client access.

The data management application creates a snapshot by copying data froma data source, which may be a primary or secondary storage (e.g., backupservers), to a storage destination. This storage destination can be astorage appliance between the data source and private or public cloudstorage (i.e., storage hosted and/or managed by a cloud serviceprovider). The storage appliance is the destination for the snapshotsfrom the perspective of the data source, but operates as a cache forsnapshots to be ultimately stored in cloud storage. A snapshot that hasnot been evicted from the storage appliance can be expeditiouslyrestored from the storage appliance. The storage appliance can alsoefficiently respond to at least metadata related requests because thestorage appliance maintains metadata for snapshots, both cached andevicted snapshots. The efficient operation of the storage appliance canhelp ensure compliance with a customer's recovery time objective (RTO)while the storage appliance also fulfills data retention demands of acustomer by archiving snapshots in the cloud storage. The storageappliance satisfies the different data management goals of disasterrecovery and data retention.

The storage appliance derives efficiencies while satisfying differentdata management goals with an arrangement of snapshot metadata andsnapshot data. The storage appliance arranges snapshot data and snapshotmetadata into different structures, and arranges the snapshot metadatato facilitate efficient snapshot manipulation, which may be for snapshotmanagement or snapshot restore. The storage appliance receives snapshotsaccording to a forever incremental configuration and arranges snapshotmetadata into different types of records. The storage appliance storesthese records in key-value stores maintained for each defined datacollection (e.g., volume). The storage appliance arranges the snapshotmetadata into records for inode information, records for directoryinformation, and records that map source descriptors of data blocks tosnapshot file descriptors. The storage appliance uses a locallygenerated snapshot identifier as a key prefix for the records to conformto a sort constrain of the key-value store, which allows the efficiencyof the key-value store to be leveraged. The snapshot metadataarrangement facilitates efficient snapshot restore, file restore, andsnapshot reclamation.

Example Illustrations of Snapshot Layout on Cloud Cache StorageAppliance

FIG. 1 is a diagram of an example storage appliance that arrangessnapshot metadata into key-value stores for each defined data collectionfor which a snapshot is received. A storage appliance 101 includes or iscommunicatively coupled with an array of storage devices 102 (e.g., adisk array, a flash storage bank, a hybrid storage array, etc.). Thestorage appliance 101 can use some or all of the storage device array102 to cache data from a data source that is eventually evicted to acloud storage 119. The storage appliance 101 includes a protocol stack103 and an appliance snapshot manager 109.

The protocol stack 103 is a stack of software that, in thisillustration, processes data streams of snapshots (“snapshot streams”)for defined data collections. A defined data collection is anidentifiable collection of data that can be a volume, partition, virtualdisk, file system instance, etc. The protocol stack 103 performscommunication/network protocol processing, and possible additionalprotocol processing to extract snapshot components from the snapshotstreams. A snapshot component can be a message, object, operation, etc.,that indicates whether the information in the snapshot relates to dataor metadata, a directory change, an inode metadata change, etc. Theprotocol stack 103 extracts and formats the snapshot components forprocessing by the appliance snapshot manager 109. The protocol stack 103may process snapshot streams across multiple connections from multipledata sources. The protocol stack 103 performs handshaking operationswith a data source to exchange information about a defined datacollection and snapshots available at the storage appliance 101 for thedefined data collection.

The appliance snapshot manager 109 arranges snapshot metadata andsnapshot data received from the protocol stack 103. The appliancesnapshot manager 109 arranges the snapshot metadata into an appropriateone of the key-value stores 107 maintained by the appliance snapshotmanager 109. In this example illustration, separate key-value stores aremaintained by defined data collection. Examples of the snapshot metadatainclude inode attributes, directory information, and locationinformation of data blocks within snapshot data files. The appliancesnapshot manager 109 maintains snapshot data files 117 by snapshot andby defined data collection. The appliance snapshot manager 109 canarrange the snapshot data files by deriving a file naming scheme foreach snapshot data file that is based on locally generated snapshotidentifiers. The appliance snapshot manager 109 stores the snapshot datafiles in the array 102, and can store the snapshot data files into paths(e.g., folders, directories, etc.) that align with the different defineddata collections. Similarly, the appliance snapshot manager 109 storesthe snapshot metadata 107 in the array 102 and can arrange them byfilenames based on the defined data collection identifiers and adifferent path for each defined data collection. The storage appliance101 migrates the snapshot data files to the cloud storage 119 after thefiles are closed, which occurs after a snapshot stream ends. Migratingthe data to cloud storage 119 can include one or more datamanagement/efficiency operations, such as deduplication, compression,and/or encryption. The storage appliance 101, however, maintains thesnapshot metadata and copies the snapshot metadata to the cloud storage119. The storage appliance 101 can copy the metadata to the cloudstorage 119, but can also apply data management/efficiency operations tothe metadata and write the modified metadata to the cloud storage 119.

FIG. 2 is a diagram of snapshot metadata in a key-value store maintainedat a storage appliance. In FIG. 2, a data source 203 and a data source205 backup data to a data management application instance 213 and a datamanagement application instance 215, respectively. The data managementapplication instances 213, 215 may be running on the data sources 203,205 or on other devices. The data management application instances 213,215 may be instances of a standalone application (e.g., backupapplication) or instances of a component of an application or operatingsystem. FIG. 2 depicts a portion 211 of an example defined datacollection on the data source 203. The portion 211 includes a rootdirectory, a child directory “FOO” and three files in the childdirectory: BAR, BAZ, and QUX. The data management application instances213, 215 communicate forever incremental snapshot streams to a cloudcache storage appliance 201 according to a policy 217. The policy 217can specify the snapshot paradigm, data collection restrictions, servicelevel objectives, time period per snapshot, etc. The storage appliance201 manages the received snapshots according to a policy 223. The policy223 can specify a retention amount or retention time for snapshots to beavailable from the storage appliance 201, deduplication parameters, dataarchive requirements, data security parameters, etc. The storageappliance 201 archives snapshots into a cloud storage 225 according tothe policy 223.

When the storage appliance 201 receives a snapshot, the storageappliance 201 inserts snapshot metadata records into the appropriatekey-value store and writes corresponding data blocks into snapshot datafiles. The storage appliance 201 uses a global map 227 to resolve adefined data collection identifier “A” associated with a snapshot to akey-value store 230 (also referred to as a key-value database) and acollection of snapshot data files 231 for the defined data collection A.The storage appliance 201 can also indicate in the global map 227 thesnapshots represented in the key-value stores per defined datacollection, as well as parent-child relationships among those snapshots.The storage appliance 201 can also store in the global map 227 thebindings of source snapshot identifier to local snapshot identifier. Aspreviously mentioned, the local identifiers are generated. The localsnapshot identifiers identify snapshots while also implicitly indicatingorder of the snapshots. Source snapshot identifiers (i.e., snapshotidentifiers generated at the snapshot source), such as universallyunique identifiers (UUIDs), are not necessarily deterministic and, thus,may not imply order of the snapshots. The binding of source snapshotidentifier to local snapshot identifier allows the storage appliance toresolve the identifiers in both directions: from source snapshotidentifier to local snapshot identifier to access snapshot metadata inthe key-value stores and from local snapshot identifier to sourcesnapshot identifier to communicate with the data source about thesnapshots.

FIG. 2 separately depicts the different types of snapshot metadata inthe key-value store 230. The storage appliance 201 could maintain adifferent key-value store for each different type of snapshot metadatainstead of a key-value store with the different types of snapshotmetadata. The storage appliance 201 arranges the snapshot metadata intofile attribute metadata 233 (“inode metadata” or “inode records”),directory metadata 235 (“directory records”), and data map metadata 237(“data map records”). All of the snapshot metadata records illustrateuse of local snapshot identifiers as key prefixes. The storage appliance201 can use a monotonically increasing counter for each new snapshot. Inthis example, a baseline snapshot has a local identifier of “1” andsubsequent incremental snapshot has a local snapshot identifier of “2.”Thus, the example data illustrates that two snapshots have been receivedfor the defined data collection A. The storage appliance 201 constructsa key for an inode record from a local snapshot identifier and an inodenumber. The values for an inode record are the file attributes (e.g.,author, create time, last modified time, etc.) for the inode in thecorresponding snapshot. The storage appliance 201 constructs a key for adirectory record from a local snapshot identifier, a parent inodenumber, and a child name. The child name may be a name of a file or adirectory. The value in a directory record is at least an inode numbercorresponding to the child name. The storage appliance 201 constructs akey for a data map record from a local snapshot identifier, an inodenumber, and a source file offset (i.e., offset of a containing file ascommunicated in the snapshot). The value in a directory record is atleast a length of the data block and a snapshot data file offset. Thesnapshot data file offset is the offset for the data block within thesnapshot data file created by the storage appliance 201. A snapshot datafile is an aggregation of the data for files within a correspondingsnapshot.

The storage appliance 201 writes data for a snapshot into a file for thesnapshot, which has been referred to as a snapshot data file. In FIG. 2,the storage appliance 201 has created a snapshot data file 239 for thesnapshot 1 and a snapshot data file 241 for the snapshot 2. As depictedin the data map records 237, the offset value in the third columncorresponds to the offsets within the corresponding snapshot data files.The storage appliance 201 has written the snapshot 1 data block or datarange for inode 97 with source file offset 512 (key “1:97:512”) andlength of 88 megabits (Mb) into the snapshot data file 239 at offset512. The storage appliance 201 has written the snapshot 1 data block forinode 98 with source file offset 0 and length of 256 Mb into thesnapshot data file 239 at offset 600. Data of the inode 97 was changedin snapshot 2. More specifically, data at source file offset 100 forinode 97 was changed with data having a length of 50 Mb. For this changein snapshot 2, the storage appliance 201 has written this changed datablock into the snapshot data file 241 at offset 0 as shown by the datamap record with key “2:97:100.”

The simple example data of FIG. 2 is sufficient to conceptually describethe snapshot data and metadata arrangement maintained at a storageappliance that operates as a cloud storage cache. Additional metadatacan be maintained with the same paradigm of keys. For example,additional metadata can be maintained for access control lists and othergranularities of data containers (e.g., logical unit number (LUN)). Withthis introduction of the snapshot data and metadata arrangement orlayout, the description presents flowchart FIGS. 3-14. These figuresdepict example operations for creating records for a snapshot, snapshotrestore, file restore, and snapshot reclamation. The Figures will referto a snapshot manager as performing the example operations forconsistency with FIG. 1. This name “snapshot manager” is a logicalconstruct to coherently identify the functionality of a program(s) thatperforms the operations.

FIG. 3 is a flowchart of example operations for updating acloud-integrated appliance with a snapshot. The example operationspresume receipt of “snapshot components” from a snapshot stream. Asnapshot component can be a message, object, operation, etc., thatindicates whether the information in a snapshot relates to data ormetadata, a directory change, an inode metadata change, etc.

At block 301, a snapshot manager detects a snapshot transfer andreceives information that has been extracted from a snapshot stream. Theinformation identifies a defined data collection and a source snapshotidentifier. When a new snapshot transfer is detected, the snapshotmanager may perform preparatory operations for the snapshot stream. Forexample, the snapshot manager may create an empty snapshot data file andname the snapshot data file based on the local snapshot identifier thatwill be assigned to the snapshot.

At block 303, the snapshot manager updates a data collection map(“global map”) to associate the defined data collection and thespecified snapshot. This update can involve adding the snapshotidentifier to a list of snapshot identifiers received for the defineddata collection, updating a parent-child snapshot relationship, etc.

At block 305, the snapshot manager assigns a local identifier for thesnapshot and determines a key-value store for the defined datacollection from the global map. The snapshot manager binds the localidentifier to the source snapshot identifier. This can be done in theglobal map or a separate structure that indicates associations betweenlocal snapshot identifiers and source snapshot identifiers.

At block 307, the snapshot manager begins processing each snapshotcomponent from the snapshot stream. The snapshot manager can readsnapshot components from a queue, receive the components viainter-process communication from a protocol stack, etc.

At block 309, the snapshot manager determines the type of snapshotcomponent. The snapshot manager creates a record for each snapshotcomponent depending upon the type of information conveyed. The snapshotcomponent may include a flag or value that indicates the component type.The snapshot manager may determine the type based on content of thesnapshot component. The snapshot component may be a requested operation,e.g., a request to update a directory path or file attribute. If thesnapshot component indicates inode information, then control flows toblock 311. If the snapshot component indicates directory information,then control flows to block 313. If the snapshot component indicates adata block, then control flows to block 315.

At block 311, the snapshot manager creates and inserts an inode recordinto the key-value store for the defined data collection. The snapshotmanager creates the inode record with a key based on the local snapshotidentifier assigned to the snapshot and an inode number indicated in thesnapshot component. The snapshot manager creates the inode record withinode metadata (e.g., attributes) from the snapshot component. Controlflows from block 311 to block 317.

At block 313, the snapshot manager creates and inserts a directoryrecord into the key-value store for the defined data collection. Thesnapshot manager creates the directory record with a key based on thelocal snapshot identifier assigned to the snapshot and a parent inodenumber and child name from the snapshot component. The parent inodenumber identifies a container file system object (e.g., folder ordirectory). The child name may be a name of a container or a file. Thesnapshot manager creates the directory record with the inode numbercorresponding to the child name as the record value. Control flows fromblock 313 to block 317.

At block 315, the snapshot manager appends the data block to thesnapshot data file for the snapshot. The snapshot data file was createdbased on detecting the snapshot stream beginning (e.g., opening aconnection or session for transmission of the snapshot stream). Thesnapshot manager records the offset at which the data block was writteninto the snapshot data file

At block 316, the snapshot manager creates and inserts a data map recordinto the key-value store for the defined data collection. The snapshotmanager creates the data map record with a key based on the localsnapshot identifier assigned to the snapshot, the inode number of thefile that contains the data block, and a source file offset indicated inthe snapshot component. The snapshot manager creates the data map recordwith the length of the data block and the snapshot data file offset asthe value. Control flows from block 316 to block 317.

At block 317, the snapshot manager determines whether the end of thesnapshot has been reached. Although the snapshot and the snapshot streammay be conceptually interchangeable, the snapshot stream includescorresponding communication infrastructure for communicating a snapshot.Thus, the snapshot manager may receive all of the data for a snapshotbut the snapshot stream may still be considered active since the sessionhas not been torn down yet. The snapshot manager may receive acommunication when a snapshot ends and begins, but may not be informedwhen the snapshot stream (i.e., a session or connection) is interruptedor restarted. The snapshot manager may receive a termination command orclose command that signifies ending of the snapshot. If the end of thesnapshot has not been reached, then control flows back to block 307.Otherwise, control flows to block 319.

At block 319, the snapshot manager closes the snapshot data file. Thesnapshot data file can be migrated to cloud storage after it is closed.

At block 321, the snapshot manager updates the local snapshot identifierfor assignment to the next received snapshot. For example, the snapshotmanager increments a counter.

FIGS. 4-6 are flowcharts of example operations for restoring a snapshotleveraging the snapshot layout described above. FIG. 4 is a flowchart ofexample operations for restoring a snapshot of a defined datacollection. The restore operations use the already described snapshotmetadata records and snapshot data files to efficiently restore asnapshot. If a relevant snapshot data file has been evicted from astorage appliance, then the storage appliance will download the snapshotdata file. Restoring a snapshot will merge valid records and data ofsnapshots that precede the snapshot being restored back to the baselinesnapshot. The snapshot being restored controls validity.

At block 401, a snapshot manager detects a restore request thatspecifies a data collection and a snapshot. The snapshot managerreceives a request that includes a defined data collection identifierand a source snapshot identifier. The restore request also indicates arestore target (i.e., where snapshot information should be communicatedfor the restore).

At block 403, the snapshot manager identifies a snapshot key-value storefor the specified defined data collection and determines a localsnapshot identifier for the specified snapshot. The snapshot manageraccesses data collection metadata to determine a local snapshotidentifier bound to the source snapshot identifier. The snapshot manageralso identifies the key-value store for the defined data collection. Forexample, the snapshot manager resolves the data collection identifier toa reference or path to the key-value store. The key-value store may havea name based on the data collection identifier.

At block 405, the snapshot manager identifies a baseline snapshot forthe specified snapshot. The snapshot manager accesses a structure thatindicates parent-child relationships among snapshot for each defineddata collection. The snapshot manager tracks a baseline snapshot as aparent and subsequent incremental snapshots as children of the baselinesnapshot.

At block 407, the snapshot manager retrieves records from the identifiedkey-value store using the local snapshot identifier as a key prefix. Theretrieved records include inode records, directory records, and data maprecords. The snapshot manager retrieves all of the records into workingmemory (e.g., random access memory) to merge records. The snapshotmanager may retrieve and merge by record type instead of retrieving allrecords by local snapshot identifier.

At block 409, the snapshot manager determines whether the specifiedsnapshot is a baseline snapshot. The snapshot manager can compare thelocal identified of the specified snapshot with the local identifier ofthe baseline snapshot determined at block 405. If the specified snapshotis a baseline snapshot, then control flows to block 411. Otherwise,control flows to block 415.

At block 415, the snapshot manager creates an inode attribute structurewith inode records of the specified snapshot. The inode attributestructure is a temporary data structure to host merged inode records.The snapshot manager initially creates the inode attribute structurewith the inode records of the specified snapshot because the specifiedsnapshot controls validity in case of a conflict during merging.

At block 417, the snapshot manager tracks the parent inode number andchild name pairs of the retrieved directory records. The snapshotmanager uses the tracked pairings to identify directory records ofpreceding snapshots invalidated by the specified snapshot directoryrecords.

At block 419, the snapshot manager communicates the directory recordsthat were retrieved to a restore target that was indicated in therestore request. The snapshot manager can determine those of theretrieved records that are directory records by examining either the keyor the value. The retrieved directory records are valid since they areof the specified snapshot.

At block 421, the snapshot manager creates a restore data map with thedata map records of the specified snapshot. The snapshot manager createsthe restore data map with the ranges of data blocks of the specifiedsnapshot, since these data blocks are controlling.

At block 423, the snapshot manager retrieves and merges records ofsnapshots back to the baseline snapshot. The snapshot manager determineswhich records are invalid in light of the specified snapshot record andmerged records. FIG. 5 provides additional details about this exampleoperation.

At block 425, the snapshot manager communicates the inode attributesstructure to the restore target. The inode attributes structure now hasinformation from the valid inode records that have been collected fromthe current snapshot back to the baseline snapshot. Directory recordshave already been used to help the restore target reconstruct thesnapshot structure prior to receipt of the snapshot data.

At block 427, the snapshot manager communicates valid data blocks to therestore target based on the restore data map.

If the specified snapshot was determined to be the baseline snapshot atblock 409, then the snapshot manager communicates retrieved inoderecords and directory records to the restore target at block 411. Sincethe specified snapshot is the baseline snapshot, merging can be avoided.

At block 412, the snapshot manager accesses a snapshot data file for thespecified snapshot. The snapshot manager can use the local identifier ofthe specified snapshot to identify the appropriate snapshot data file.The snapshot manager also assembles the data into a buffer according tothe data map records.

At block 413, the snapshot manager communicates the data buffer andinformation from the data map records to the restore target. Thesnapshot manager can communicate information about the inode number,source file offset, and data block length.

FIG. 5 is a flowchart of example operations for retrieving and mergingrecords of snapshots back to the baseline snapshot. FIG. 5 correspondsto block 423 of FIG. 4.

At block 501, the snapshot manager begins iterating over each snapshotpreceding the specified snapshot back to the baseline snapshot. Thesnapshot manager can use the parent-child relationship metadata todetermine the preceding snapshots and the baseline snapshot. Thedescription will refer to the currently iterated snapshot as theselected snapshot.

At block 503, the snapshot manager retrieves records from the identifiedkey-value store using the local snapshot identifier of the selectedsnapshot as a key prefix. Using the local snapshot identifier of theselected snapshot as the key prefix will retrieve all of the records inthe key-value store for the selected snapshot: the inode records, thedirectory records, and the data map records.

At block 505, the snapshot manager merges valid ones of the retrievedinode records into the inode attribute structure. The snapshot managercompares the inode numbers of the retrieved records against those in theinode attribute structure. If a match is found, then the retrievedrecord is discarded because the valid version of the inode record forthe snapshot being restored as already been written into the inodeattribute structure.

At block 507, the snapshot manager communicates to the restore targetthose of the retrieved directory records that indicate parent inode andchild name pairs not already communicated to the restore target. Thesnapshot manager can compare the parent inode number and child namepairs of the retrieves records against the list tracking those pairingsalready communicated. If already communicated, then the valid directoryrecord for the snapshot being restored has already been communicated.

At block 509, the snapshot manager updates the tracked parent inodenumber and child name pairs of directory records that have already beencommunicated back to restore target.

At block 511, the snapshot manager identifies valid data ranges from thedata map records of the selected snapshot and merges the valid rangesinto the restore data map. The snapshot manager can determine ranges foreach inode represented in the data map records of the selected snapshot.The snapshot manager can then compare ranges with the offset and lengthsof data map records. Data ranges already in the data map are valid andany overlapping or matching ranges from the selected snapshot data maprecords have been overwritten and are invalid. For a data map recordthat indicates a data range that is partially valid, the snapshotmanager can modify the offset and length indicated in the data maprecord to only encompass the valid sub-range(s) of the range. Thesnapshot manager could also annotate a data map record that indicates adata block with a valid sub-range(s). This snapshot manager could usethe annotation to guide in copying data from the snapshot data filelater. A data map record that only indicates an invalid range isdisregarded.

At block 513, the snapshot manager determines whether it has processedthe baseline snapshot. If the snapshot manager has not yet reached thebaseline snapshot, then control returns to block 501.

FIG. 6 is a flowchart of example operations for communicating valid datablocks to the restore target based on the restore data map. FIG. 6corresponds to block 427 of FIG. 4. With the valid data ranges nowdefined in the restore data map created in FIG. 4 and updated in FIG. 5,the snapshot manager can return valid data blocks from the snapshot datafiles. Embodiments, however, may communicate all data map records backto the restore target and allow a backup application, for example, atthe restore target to reassemble the data files.

At block 601, the snapshot manager selects the first record of therestore data map. The snapshot manager can create the restore data mapas another key-value store that stores the keys of merged records forordering records by snapshot and then inode. The snapshot manager canextract the information from the merged records into a different,temporary data structure. The restore data map indicates the snapshotsin order from the snapshot being restored back to the baseline snapshot.In other words, the snapshot manager can iterate over each data maprecord that was merged into the restore data map. The snapshot indicatedin a currently iterated record is referred to as the selected snapshot.

At block 603, the snapshot manager loads the snapshot data file of theselected snapshot. Loading the snapshot data file may be from localstorage into memory of a storage appliance or downloading from cloudstorage.

At block 605, the snapshot manager copies into a buffer a data blockdefined by the valid data range identified in the record. The snapshotmanager determines the data ranges for each inode number in the selectedsnapshot data file. Since the inode numbers also influence ordering ofthe data map records, the snapshot manager can walk the merged recordswhich will be in order of snapshots and inode numbers.

At block 607, the snapshot manager updates a buffer descriptor for thedescriptor to indicate the inode number, the source file offset, and thedata block length. The buffer descriptor guides the restore target inassembling the data blocks from the buffer into the files.

At block 609, the snapshot manager determines whether the bufferthreshold is satisfied. The buffer threshold can be configured with apolicy or dynamically by the snapshot manager based on availableresources of the storage appliance. If the buffer threshold issatisfied, then control flows to block 611. If not, then control flowsto block 613.

At block 611, the snapshot manager flushes the buffer to the restoretarget along with the buffer descriptor. The snapshot managercommunicates the buffer contents and buffer descriptor to the restoretarget via a protocol stack, for example. The buffer is emptied forstoring additional data blocks. Control flows to block 613 from 611.

At block 613, the snapshot manager determines whether there is anadditional record in the restore data map. If there is an additionalrecord, then control flows to block 615. At block 615, the snapshotmanager selects the next record in the restore data map. Control flowsfrom block 615 to block 603. If there is not another record in therestore data map, then control flows to block 617.

At block 617, the snapshot manager determines whether the buffer isempty. If the buffer is not empty, then the snapshot manager flushes thebuffer and buffer descriptor to the restore target.

FIGS. 7-9 are flowcharts for example operations to restore a file. FIG.7 is a flowchart of example operations for restoring a file from aspecified snapshot. These example operations illustrate a differentgranularity of restoration that is possible. Other levels of granularity(e.g., LUN) can also be restored assuming snapshot metadata has beenmaintained for the specified level of granularity in the key-valuestore. The initial operations are similar to those for a snapshotrestore. In FIG. 7, the example operations represented by blocks 701 and703 are similar to those represented by blocks 401 and 403.

At block 701, a snapshot manager detects a restore request thatspecifies a defined data collection, a snapshot, and a file. Thesnapshot manager receives a request that includes a defined datacollection identifier, a source snapshot identifier, and a file name.The restore request also indicates a restore target (i.e., wheresnapshot information should be communicated for the restore).

At block 703, the snapshot manager identifies a snapshot key-value storefor the specified defined data collection and determines a localsnapshot identifier for the specified snapshot. The snapshot manageraccesses data collection metadata to determine a local snapshotidentifier bound to the source snapshot identifier. The snapshot manageralso identifies the key-value store for the defined data collection. Forexample, the snapshot manager resolves the data collection identifier toa reference or path to the key-value store. The key-value store may havea name based on the data collection identifier.

At block 705, the snapshot manager incrementally searches directoryrecords of snapshots for the inode number of the file to be restored.The snapshot manager incrementally searches elements of the pathname(e.g., each directory or folder) of the file to be restored. Thesnapshot manager finds the inode number of each path element and thensearches for the next element using the resolved inode number of thepreceding element. For example, the snapshot begins to search thedirectory records for “/segment1” to eventually find the inode numberfor a file “/segment1/segment2/segment3/foo_file.” the snapshots fromthe specified snapshot back through preceding snapshots.

FIG. 8 is a flowchart of example operations for this incremental searchof directory records. Since the directory records are stored in akey-value store for a data collection that includes the file beingrestored, the snapshot manager searches directory records with a keyprefix constructed from an inode number and a child name (i.e., name ofthe path element). After finding the child inode number (i.e., the inodenumber of the path element being searched for), the snapshot managerprogresses to search the next path element until finding the inodenumber of the file to be restored.

At block 801, the snapshot manager sets the inode root number as a firstprefix search parameter. The snapshot manager uses variables toconstruct (and reconstruct) a key prefix for searching directoryrecords. The first prefix search parameter is the first part of the keyprefix to be used for searching. The snapshot manager initially sets thefirst prefix search parameter to a known inode number, which is the rootinode number in this example.

At block 802, the snapshot manager begins searching through thedirectory records of the snapshots from the specified snapshot to eachpreceding snapshot until finding the inode number being searched for.Initially, the snapshot manager begins the search with the specifiedsnapshot.

At block 803, the snapshot manager sets a variable as the specifiedsnapshot (i.e., the local snapshot identifier of the specifiedsnapshot). The snapshot manager also sets a search prefix as the firstsearch prefix parameter and the path element. For example, the snapshotmanager sets the search prefix to be “77:dept1.”

At block 804, the snapshot manager retrieves directory records from theidentified key-value store using the local snapshot identifier of thesearch snapshot as a key prefix. Assuming a snapshot metadataarrangement that stores the various types of records in a same key-valuestore, the snapshot manager can use metadata of the key-value store toselectively retrieve the directory records with the key prefix and notall records with the matching key prefix (i.e., not retrieve the inoderecords of the search snapshot). If the snapshot manager maintains thedifferent types of snapshot metadata in different key-value stores, thenthe snapshot manager can retrieve all records by the key prefix from thekey-value store for directory metadata.

At block 807, the snapshot manager searches the retrieved directoryrecords for the search prefix. The snapshot manager searches through thekeys of the retrieved directory records for an entry with an inodenumber and child name that matches the search prefix. Control flows fromblock 807 to block 809.

At block 809, the snapshot manager determines whether the path elementbeing searched resolved to an inode number. In other words, the snapshotmanager determines whether a match to the search prefix was found in oneof the retrieved directory records. If the inode number was found, thencontrol flows to block 813. If the inode number was not found, thencontrol flows to block 810.

At block 810, the snapshot manager determines whether the searchedsnapshot is the baseline snapshot. The snapshot manager maintainsmetadata that indicates which snapshots are baseline snapshots. If thesearched snapshot is a baseline snapshot, then the file has not beenfound and the snapshot manager indicates that the file was not found atblock 812. If the searched snapshot is not a baseline snapshot, thencontrol flows to block 811.

At block 811, the snapshot manager sets the preceding snapshot as thesearch snapshot. For example, the snapshot manager updates a variable“search snapshot” to be the local snapshot identifier of the snapshotthat precedes the current snapshot. Control flows from block 811 back toblock 804.

At block 813, the snapshot manager sets the first prefix searchparameter as the resolved inode number. The snapshot manager updates thefirst prefix search parameter to be the resolved inode number in orderto continue incrementally searching.

At block 815, the snapshot manager determines whether the path elementis the name of the file to be restored. If the path element is not thefilename, then the snapshot manager searches for the next path elementrestarting with the specified snapshot as the search snapshot. If thepath element is the filename, then the snapshot manager has found theinode number of the file to be restored. That inode number has beenstored in the first prefix search parameter. At block 816, the inodenumber is returned as the first prefix search parameter. The inodenumber is then used to obtain the data for restoring the file using thedata map records as indicated in either of blocks 717 and 719 of FIG. 7.

At block 715, the snapshot manager determines whether the specifiedsnapshot is the baseline snapshot. If the specified snapshot is thebaseline snapshot, then the file can be restored with the baselinesnapshot and control flows to block 717. Otherwise, control flows toblock 719.

At block 717, the snapshot manager retrieves the data map records usingthe local identifier of the specified snapshot, which in this case isthe local identifier of the baseline snapshot, and the inode numberfound in the baseline directory records as a key prefix. The snapshotmanager then reconstructs the file according to the retrieved data maprecords. To reconstruct the file, the snapshot manager loads thebaseline snapshot data file and assembles the data according to theoffset and lengths indicated in the data map records. Embodiments couldinstead write the baseline snapshot data file to a buffer andcommunicate the buffer to the restore target along with a bufferdescriptor that indicates the source file offsets and lengths. Therestore target can reassemble the file with the buffer and bufferdescriptor. Control flows from block 717 to block 721.

At block 719, the snapshot manager merges data map records acrosssnapshots and reconstructs the specified file according to the mergeddata map records. The merging discards invalid data ranges and maintainsvalid data ranges as each preceding snapshot data map record is mergedwith the data map records of the specified snapshot.

At block 721, the snapshot manager communicates the restored file to therestore target.

FIG. 9 is a flowchart of example operations for merging data map recordsacross snapshot and reconstructing a specified file according to themerged data map records. FIG. 9 corresponds to block 719 of FIG. 7.

At block 901, a snapshot manager retrieves data map records from theidentified key-value store using the local snapshot identifier of thespecified snapshot and the resolved inode number as a key prefix. Withthe retrieved data map records, the snapshot manager creates a filerestore map. The file restore map is similar to the data restore mapused when restoring a snapshot. The file restore map is a temporarystructure to track valid data ranges as data map records of precedingsnapshots are examined to determine validity of data range identified bythe data map records. The file restore map is eventually used to gatherdata blocks for restore of the file.

At block 903, the snapshot manager begins operations for each priorsnapshot back to the baseline snapshot. The snapshot manager candetermine the local identifier of each prior snapshot based on the localidentifier of the specified snapshot or selected snapshot. The snapshotbeing evaluated is referred to as the selected snapshot.

At block 905, the snapshot manager retrieves data map records from theidentified key-value store using the local snapshot identifier of thespecified snapshot and the resolved inode number as a key prefix. Thesnapshot manager will evaluate the data ranges of the retrieved data maprecords to determine valid ranges.

At block 907, the snapshot manager identifies a valid data range(s) fromthe retrieved data map records of the selected snapshot and merges theidentified valid data range(s) into the file restore map based on thevalid data range(s). To merge, the snapshot manager can insert a datarange that has no overlap with any data range already present in thefile restore map. This can be determined by comparing the source fileoffsets and lengths. If an overlap is detected, the snapshot manager canmodify the offset and/or length of the data map record being merged toindicate only the valid range(s). If the valid data range(s) splits adata range indicated by a data map record, the snapshot manager cancreate an additional record in the file restore map with the additionalvalid range or annotate the existing data map record with a source fileoffset and length that defines the additional valid data range.Modification of source file offset and/or length to identify a validdata range(s) may also cause modification of a corresponding snapshotdata file offset. For instance, a data block may have a source offset of256, a length of 100, and a snapshot data file offset of 300. Thesnapshot manager determines that the data at offset 300 to 350 wasoverwritten. Thus, the data block has been split into a valid range fromoffset 256 to 300 and from offset 350 to 356. Within the snapshot datafile, the valid data range is now from offset 300 to 344 and from offset394 to 400. The snapshot manager will record the changes in both sourcefile offsets and snapshot data file offsets and the change length to twodifferent lengths of 44 Mb and 6 Mb.

At block 909, the snapshot manager determines whether the baselinesnapshot has been reached (i.e., is the selected snapshot the baselinesnapshot). If the baseline snapshot has been reached, then processingcontinues to block 911. Otherwise control returns to block 903.

At block 911, the snapshot manager begins assembling data to restore thefile from each snapshot data file corresponding to each snapshotindicated in the file restore map. The snapshot manager selects asnapshot by selecting the local identifier of the selected snapshot.

At block 913, the snapshot manager loads the snapshot data file of theselected snapshot. The snapshot manager loads the file from a filesystem of the hosting storage appliance or download the snapshot datafile from cloud storage. The snapshot manager determines location andidentity of the snapshot data file with the defined data collectionidentifier and the local snapshot identifier. As previously mentioned,the snapshot manager may organize snapshot data files in pathscorresponding to the owning defined data collection and name thesnapshot data files based on the local snapshot identifier.

At block 915, the snapshot manager reconstructs the file as indicated inthe file restore map. The snapshot manager can read data out from thesnapshot data file into a buffer according to the snapshot data fileoffset and length indicated in the file restore map record for theselected snapshot and resolved inode number. If reading the data into abuffer, the snapshot manager can also update a buffer descriptor withthe source file offset and data block length.

At block 917, the snapshot manager determines whether the file restoremap indicates another snapshot. If not, then the merging ends. If thereis another snapshot indicated in the file restore map, control returnsto block 911.

In addition to restore operations, a snapshot manager allows fordeletion of snapshots. When one or more snapshots are deleted, the validsnapshot metadata and snapshot data of the snapshot(s) to be deleted aremerged into a succeeding snapshot. This is referred to as snapshotreclamation. FIG. 10 is a flowchart of example operations for snapshotreclamation, while FIGS. 11-14 expand upon example operations withinFIG. 10.

At block 1001 of FIG. 10, a snapshot manager detects a request to deletea specified snapshot(s) for a defined data collection. The requestidentifies a defined data collection and one or more snapshots fordeletion.

At block 1003, the snapshot manager marks the identified snapshot(s) fordeletion. The snapshot manager can maintain data collection metadatathat describes a defined data collection (e.g., source identifier,source name, owners, etc.). The data collection metadata can alsoindicate the snapshots that have been created for the defined datacollection. The snapshot manager can set a flag or value in the datacollection metadata that indicates deleted snapshots.

At block 1005, the snapshot manager determines whether a reclamationthreshold is satisfied for the defined data collection. A threshold canbe configured for all data collections or each data collection thatcommunicates snapshots to the snapshot manager. As examples, thethreshold can be a number of snapshots marked for deletion, a timeperiod since a snapshot has been marked for deletion, and/or an amountof data corresponding to the snapshot(s) to be deleted calculated basedon a running average change rate. If the threshold is not yet satisfied,the process ends.

If the threshold is satisfied, then the snapshot manager determineslocal identifiers of the snapshot(s) marked for deletion at block 1007.For example, the snapshot manager may read data collection metadata thatbinds source snapshot identifiers to local snapshot identifiers.

At block 1009, the snapshot manager identifies a most recent of themarked snapshot(s). This identified snapshot is referred to as theselected snapshot. The snapshot manager can identify the most recent asthe marked snapshot with the greatest local identifier since the locallygenerated snapshot identifiers are deterministic.

At block 1011, the snapshot manager identifies a snapshot subsequent tothe selected snapshot, i.e., a most recent adjacent snapshot not markedfor deletion. This subsequent snapshot is referred to as the validsnapshot because it will take ownership of valid data from the selectedsnapshot.

At block 1013, the snapshot manager retrieves records from the key-valuestore of the defined data collection using the local identifier of thevalid snapshot as a key prefix. This retrieves the various metadatarecords for the valid snapshot, which are used as controlling, validsnapshot metadata.

At block 1015, the snapshot manager retrieves records from the key-valuestore of the defined data collection using the local identifier of theselected snapshot as a key prefix. These are retrieved to allow thesnapshot manager to identify valid data of the selected snapshot.

At block 1017, the snapshot manager implicitly transfers ownership ofvalid inode records and valid directory records to the valid snapshot.The transfer of ownership is implicit because valid inode and directoryrecords of the “deleted” snapshot will continue to indicate the snapshotmarked as deleted in their key prefixes. However, then snapshot managerwill process records, for example when performing a restore, thatindicate a snapshot marked as deleted as if part of a next succeedingsnapshot that is not marked as deleted.

At block 1021, the snapshot manager determines valid data ranges of theselected snapshot and implicitly transfers the valid data ranges to thevalid snapshot. As with the directory records and the inode records, thesnapshot manager will process a snapshot data file and data map recordsof a snapshot marked as deleted as part of a next succeeding, validsnapshot. To reflect overwritten data, the implicit transfer ofownership of data map records and snapshot data can include the snapshotmanager updating ranges and “punching holes” in the snapshot data fileof snapshot to be deleted. Punching holes in a snapshot data file wouldinvolve deleting data overwritten in the valid snapshot and update thedata map record(s) accordingly.

At block 1023, the snapshot manager determines whether there is anadditional snapshot marked for deletion. The snapshot manager may alsoupdate state of the selected snapshot from a “to be deleted” state to a“deleted” state. Although deleted, the indications of the snapshots arenot removed from the data collection metadata. If there is no additionalmarked snapshot, the reclamation process ends. If there is an additionalmarked snapshot, then control flows to block 1025.

At block 1025, the snapshot manager identifies a next most recent one ofthe marked snapshots. This one is now referred to as the selectedsnapshot.

At block 1027, the snapshot manager determines whether the selectedsnapshot is adjacent to the previously selected snapshot. The snapshotmanager can maintain the snapshots to be deleted in a sorted queue anddetermine adjacency with the queue. The snapshot manager can examine thedata collection metadata to determine whether the previously selectedsnapshot and selected snapshot are adjacent (e.g., snapshot 5 andsnapshot 6 are adjacent). If the selected snapshot and previouslyselected snapshot are adjacent, then ownership continues beingtransferred to the valid snapshot. Otherwise, a new valid snapshot isidentified. If the snapshots are not adjacent, then control flows backto block 1011. If the snapshots are adjacent, then control flows back toblock 1015.

FIG. 11 is a flowchart of example operations for implicitly transferringownership of valid inode and directory records to the valid snapshot.FIG. 11 corresponds to block 1017 of FIG. 10.

At block 1101, the snapshot manager begins iterating over each of theinode records of the selected snapshot to determine validity. Thesnapshot manager can walk from the first record to the last record ofthe retrieved inode records since they are already ordered by snapshotidentifier and then inode number. The currently iterated inode record isreferred to as the selected inode record.

At 1103, the snapshot manager determines whether the inode numberindicated in the selected inode record is indicated in an inode recordof the valid snapshot. If the inode numbers match, then the inode recordof the selected snapshot is invalid. If the inode numbers match, thencontrol flows to block 1105. Otherwise, ownership implicitly transfersto the valid snapshot. Ownership of the valid inode record implicitlytransfers because ownership is presumed to be the next valid (i.e., notdeleted or marked for deletion) snapshot. This avoids the overhead ofupdating the key prefixes of valid records.

At block 1105, the snapshot manager deletes the inode record of theselected snapshot from the key-value store of the defined datacollection. This inode record is deleted because it has been changedwithin the valid snapshot.

At block 1108, the snapshot manager determines whether there is anadditional inode record of the selected snapshot to be evaluated forownership transfer. If there is an additional inode record, then controlflows to block 1101. If not, then control continues to block 1109.

At block 1109, the snapshot manager begins iterating over each of thedirectory records of the selected snapshot to determine validity. Thesnapshot manager can walk from the first record to the last record ofthe retrieved directory records since they are already ordered bysnapshot identifier and then parent inode number. The currently iterateddirectory record is referred to as the selected directory record.

At 1111, the snapshot manager determines whether the parent inode numberand child name indicated in the selected directory record is indicatedin a directory record of the valid snapshot. If the combination ofparent inode number and child name matches, then the directory record ofthe selected snapshot is invalid. If a match is found, then controlflows to block 1113. Otherwise, ownership of the directory recordimplicitly passes to the next valid snapshot as with valid inoderecords.

At block 1113, the snapshot manager deletes the directory record of theselected snapshot from the key-value store of the defined datacollection. This directory record is deleted because it has been changedwithin the valid snapshot.

At block 1117, the snapshot manager determines whether there is anadditional directory record of the selected snapshot to be evaluated forownership transfer. If there is an additional directory record, thencontrol flows to block 1109.

FIG. 12 is a flowchart of example operations for determining valid dataranges of a selected snapshot and implicitly transferring to a validsnapshot. FIG. 12 corresponds to block 1021 of FIG. 10.

At block 1201, the snapshot manager begins iterating over each retrieveddata map record of the selected snapshot. As with the other types ofrecords, the snapshot manager can traverse the records in order. Thecurrently iterated data map record is referred to as the selected datamap record.

At block 1203, the snapshot manager determines degree of overwrite, ifany, of the data range indicated by the selected data map record by anyof the data map records for the same inode in the valid snapshot datamap records. To make this determination, the snapshot manager evaluatesthe source file offset and length of the selected data map recordagainst the source file offsets and lengths of the data map records ofthe valid snapshot for the same inode number. If the data rangeindicated in the selected data map record was completely overwritten,then control flows to block 1207.

Since the data block has been overwritten, the snapshot manager deletesthe data block from the snapshot data file of the selected snapshot atblock 1207. The snapshot manager then deletes the selected data maprecord. Embodiments can instead mark the data block and the data maprecord as deleted or for deletion. Control flows from block 1207 toblock 1217.

If the snapshot manager determined that the data range of the selecteddata map record was not overwritten, then control flows to block 1217because the records and snapshot data file remain intact and will bepresumed to be owned by the next succeeding valid snapshot as previouslymentioned. This contributes to efficiency in the reclamation.

If the snapshot manager determined that the data range of the selecteddata map record was partially overwritten at block 1203, then controlflowed to block 1209. At block 1209, the snapshot manager determinesvalid data sub-ranges that were not overwritten and updates the snapshotdata file and data map records of the selected snapshot accordingly.Control flows from block 1209 to block 1217. At block 217, the snapshotmanager determines whether there is an additional data map record of theselected snapshot.

FIGS. 13-14 are flowcharts which depict example operations fordetermining valid data sub-ranges that were not overwritten and updatingdata map records of the selected snapshot accordingly. FIGS. 13-14provide example operations that elaborate on block 1209 of FIG. 12.

At block 1301, the snapshot manager compares a start and end of a datarange indicated by the selected data map record against the start andend of data ranges for the same inode indicated in the valid snapshotdata map records. The start will be the source file offset and the endwill be the length added to the source file offset. This determineswhich sub-range of the data range has not been overwritten (i.e.,remains valid): a front sub-range, a back sub-range, or a splitsub-range (i.e., a middle portion of the data range was overwritten).Each leads to a different update to the source data file offset and/orlength for merging. If the valid sub-range is a back sub-range, thencontrol flows to block 1303.

At block 1303, the snapshot manager deletes data in the front sub-rangefrom the snapshot data file of the selected snapshot. The snapshotmanager deletes the data from the indicated snapshot data file offsetfor the length of front sub-range.

At block 1307, the snapshot manager updates the data map record of theselected snapshot. The snapshot manager updates source file offset andthe snapshot data file offset in the data map record to account fordeletion of the front sub-range. For instance, the snapshot manager addsthe length of the front sub-range to the source file offset and to thedata file offset. The snapshot manager also updates the length in thedata map record to be the back sub-range length.

If the valid sub-range is a front sub-range as determined at block 1301,then control flows to block 1309. At block 1309, the snapshot managerdeletes data in the back sub-range from the snapshot data file of theselected snapshot. The snapshot manager deletes the data from the startof the back sub-range for the length of the back sub-range.

At block 1313, the snapshot manager updates the data map record of theselected snapshot to indicate the deletion of the back sub-range. Thesnapshot manager updates the length in the data map record by reducingthe length indicated by the length of the back sub-range.

If the snapshot manager determined that the data range indicated by theselected data map record was split into two valid data ranges, then thesnapshot manager updates the selected data map record for one of thevalid ranges and inserts a new data map record for the other valid datarange. At block 1401, the snapshot manager punches a hole in thesnapshot data file of the snapshot data file by deleted the data betweenthe valid sub-ranges based on the already determined lengths of thevalid sub-ranges and currently indicated data file offset.

At block 1403, the snapshot manager updates the length in the data maprecord of the selected snapshot with the length of the front sub-range.

At block 1409, the snapshot manager creates and inserts a data maprecord based on the already existing data map record. The snapshotmanager constructs the key for the new data map record from the localidentifier of the selected snapshot, the inode number, and the sourcefile offset as modified to account for the start of the back sub-range.To modify the source file offset, the snapshot manager adjusts theoriginal source file offset by the length of the front sub-range and theoverwritten sub-range to indicate the source file offset of the validback sub-range. The snapshot manager also creates the data map recordwith the length of the back sub-range and the snapshot data file offsetalso adjusted according to the length of the front sub-range and thelength of the overwritten sub-range. Although FIG. 14 updates theexisting data map record to indicate the valid front sub-range andcreates a new record for the valid back sub-range, embodiments can dothe reverse.

Example Illustrations of Synthetic Baseline Snapshots to Reduce StableData Eviction

In addition to the snapshot manager managing snapshots and creating thesnapshot data and metadata according to the described layout, thesnapshot manager can be used to reduce impairment of storage applianceefficiency from eviction mechanisms that use eviction policies that donot account for temporal locality in a forever incremental snapshotparadigm. As previously mentioned, the failure to account for thecharacteristics of a forever incremental paradigm can lead to evictionof stable data of a snapshot, which risks violating service levelobjectives. The described arrangement or layout of snapshot metadatafacilitates efficient creation of a synthetic baseline snapshot, whichis a baseline snapshot created with incremental snapshots. A storageappliance can use the synthetic baseline in tandem with refresh ofeviction state data to reduce stable data eviction.

FIG. 15 is a diagram of a cloud cache snapshot manager creating asynthetic baseline as part of reducing stable data eviction. A cloudintegrated storage appliance 1500 receives forever incremental snapshotsthat are preceded by a baseline snapshot from a data source. The cloudintegrated storage appliance 1500 is considered “cloud integrated”because it operates as a bridge and/or gateway for data being storedinto cloud storage, and integrates local data management with cloud datamanagement. The cloud integrated storage appliance 1500 caches backupdata in a cache 1508. The cache 1508 is logical cache that is comprisedof local storage (e.g., a disk array, flash storage array, or hybridarray)

The cloud integrated storage appliance 1500 receives a baseline snapshotand two subsequent incremental snapshots in FIG. 15. When the cloudintegrated storage appliance 1500 receives the baseline snapshot, thedata is stored into the cache 1508. The cloud integrated storageappliance 1500 (hereinafter “storage appliance”) updates an evictionstate data structure based on receipt of the baseline snapshot, whichresults in a first state 1503 of the eviction state data structure. Thestorage appliance 1500 updates the eviction state data structure withindications of the received data (identified in FIG. 15 as data blocksA-E) and corresponding eviction state data. In this exampleillustration, the eviction state data are time indicators and all of thereceived data are associated with a time indicator “T1,” whichrepresents when the data was received at the storage appliance 1500. Thenumber of entries (“size”) in the eviction state data structure can beconfigurable. A policy or administrator configuration can bound the sizebased on storage capacity of the cache 1508, which may also beconfigurable. The cache state data structure may not be bounded and maygrow until trimmed or cleared by the eviction mechanism (e.g., reset anend pointer in contrast with a fixed size array).

When the storage appliance 1500 receives a first incremental snapshot,the storage appliance 1500 updates the eviction state data structureresulting in a second state 1505. In the second state 1505, the evictionstate data structure indicates data blocks D′, E′, and F. Thus, the datablocks D and E have been modified since the baseline snapshot. Thestorage appliance 1500 associates these additional entries with the timeindicator T2.

When the storage appliance 1500 receives a second incremental snapshot,the storage appliance 1500 updates the eviction state data structureresulting in a third state 1507. In the second state 1507, the evictionstate data structure indicates data blocks E″ and F′. This indicatesthat the data blocks E′ and F have been modified since the secondincremental snapshot. The storage appliance 1500 associates theseadditional entries with the time indicator T3.

Assuming a next incremental snapshot includes 3 data blocks, the stabledata blocks A-C will be evicted if an eviction policy based on age(e.g., least recently used) is used. At this point in the illustration,all three of the snapshots generated to this point would use the datablocks A-C. But these data blocks would be evicted out of the storageappliance cache 1508 into cloud storage. If a restore request isreceived, then the restore would trigger download the data blocks A-Cfrom cloud storage.

To avoid this eviction of stable data and facilitate an efficientrestore with cached data blocks, an appliance snapshot manager 1501creates a synthetic baseline snapshot by manipulating the snapshotmetadata in a key-value store 1509 for the defined data collectioncorresponding to the received snapshots. The appliance snapshot manager1501 can efficiently create the synthetic baseline snapshot bymanipulating the already described layout of the snapshot metadata andavoid expensive transfers of data. The appliance snapshot manager 1501also refreshes the time indicators associated with the data blocks thatwould be used by the synthetic baseline snapshot. In this exampleillustration, the appliance snapshot manager 1501 manipulates thesnapshot metadata to use the second incremental snapshot as the basisfor the synthetic baseline snapshot. Since restore of the secondincremental snapshot would use data blocks A-C and D′, the timeindicators associated with these data blocks is set to the timeindicator T3 that is associated with the second incremental snapshot.

The storage appliance 1500 is presumed to use deduplication, so theappliance snapshot manager 1501 also updates data in a fingerprintdatabase 1511. The appliance snapshot manager 1501 updates the data inthe fingerprint database 1511 to associate the second incrementalsnapshot with the fingerprints corresponding to the data blocks A-C andD′. The appliance snapshot manager 1501 can use the local snapshotidentifier for the second incremental snapshot to associate the secondincremental snapshot with the data blocks A-C and D′ in the fingerprintdatabase 1511.

The trigger for creation of the synthetic baseline snapshot andmodification of eviction state data can vary. Although FIG. 15illustrates these operations as occurring at receipt of the secondincremental snapshot, some embodiments may perform these operations atother times, such as when each snapshot is received. In addition, abackground process may perform these operations instead of a programidentified as an appliance snapshot manager, although the backgroundprocess may be a component of an appliance snapshot manager.

FIGS. 16-20 are flowcharts of example operations for differentembodiments that create synthetic baseline snapshots and modify evictionstate data to withstand stable data eviction. The example operationspresume an arrangement of snapshot metadata and snapshot data aspreviously described. The figures refer to a snapshot manager performingthe operations for consistency with FIG. 15.

FIG. 16 is a flowchart of example operations for creating a syntheticbaseline snapshot with data ownership expansion. The example operationsexpand “ownership” of valid snapshot metadata from the original ownersnapshot and to a most recent snapshot. Ownership refers to anassociation of snapshot metadata with a snapshot identifier so that thesnapshot metadata will be retrieved for any associated snapshot whenrequested. To expand ownership, the example operations copy still validsnapshot metadata records of preceding snapshots and indicate the localsnapshot identifier of the most recent snapshot in the copied records.

At block 1601, a snapshot manager receives a snapshot and createssnapshot metadata records for the received snapshot. As described above,the snapshot manager creates inode records, directory records, and datamap records.

At block 1603, the snapshot manager determines whether a threshold forcreating a synthetic baseline is satisfied. A threshold can beconfigured that achieves a desired balance between frequency ofsynthetic baseline creations and managing the cache to avoid eviction ofstable data. The threshold may be a number of snapshots, a size ofcached data, etc. As an example, a threshold may be based on both numberof snapshots and amount of cache consumed by using a snapshot changerate (i.e., average size of incremental snapshot data). With thesnapshot change rate, the snapshot manager can set a threshold number ofsnapshots that corresponds to an expected cache consumption based on theaverage change rate. The threshold can also dynamically update byrecalculating the snapshot change rate periodically and/or in responseto detection of a trending snapshot change rate, either increasing ordecreasing trend. If the threshold is not satisfied, then the processends until a next snapshot is received. If the threshold is satisfied,then control flows to block 1605.

At block 1605, the snapshot manager begins to iterate over the snapshotsthat precede the received (or most recent) snapshot back to a baselinesnapshot or a preceding synthetic baseline snapshot. To iterate, thesnapshot manager can walk the local snapshot identifiers associated withthe defined data collection corresponding to the received snapshot. Asdescribed above, the snapshot manager maintains a global mapping or datacollection metadata that indicates received snapshots for each defineddata collection received by the snapshot manager. When the snapshotmanager creates a synthetic baseline snapshot, the snapshot managerupdates the parent-child relationship metadata for the snapshots toindicate the synthetic baseline snapshot as the parent for subsequentincremental snapshots. Alternatively, the snapshot manager can mark thesnapshot as a synthetic baseline snapshot and not modify parent-childrelationship metadata. The snapshot manager can also maintain theparent-child relationship between incremental snapshots and the baselinesnapshot and add metadata that indicates the synthetic baseline snapshotas a synthetic parent for subsequent incremental snapshots.

At block 1607, the snapshot manager retrieves the snapshot metadatarecords of the received snapshot and the preceding snapshot from thekey-value store of the corresponding defined data collection. Thesnapshot manager repeats retrieval of records of the received snapshotas it iterates over the preceding snapshots to account for theincreasing ownership of records by the received snapshot. Embodimentscan maintain the accumulation of owned valid records and limit recordretrieval from the key-value store for the received snapshot to aninitial retrieval.

At block 1609, the snapshot manager identifies one or more still validinode records of the preceding snapshot based on the received snapshotinode records. The snapshot manager compares keys of the precedingsnapshot inode records and the received snapshot inode records. Thosepreceding snapshot records with the same inode number are invalid.

At block 1611, the snapshot manager copies the valid inode records ofthe preceding snapshot and inserts them into the key-value store asrecords for the received snapshot. The snapshot manager changes the keyprefix of these copied records to the local snapshot identifier of thereceived snapshot. The “copying” can be performed by modifying thealready retrieved, valid inode records of the preceding snapshot toindicate the received snapshot local identifier as the key prefix andinserting these into the key-value store.

At block 1613, the snapshot manager identifies one or more still validdirectory records of the preceding snapshot based on the receivedsnapshot directory records. The snapshot manager compares keys of thepreceding snapshot directory records and the received snapshot directoryrecords. Those preceding snapshot records with the same parent inodenumber and child name are invalid.

At block 1615, the snapshot manager copies the valid directory recordsof the preceding snapshot and inserts them into the key-value store asrecords for the received snapshot. The snapshot manager changes the keyprefix of these copied records to the local snapshot identifier of thereceived snapshot. The “copying” can be performed by modifying thealready retrieved, valid directory records of the preceding snapshot toindicate the received snapshot local identifier as the key prefix andinserting these into the key-value store.

At block 1617, the snapshot manager identifies valid cached data blocksbased on data map records of the received snapshot. As described above,the snapshot manager can compare data ranges indicated in the data maprecords to determine data blocks that have been overwritten. Since thesnapshot manager is manipulating data for purposes related to cacheeviction, the snapshot manager limits this determination of validity tocached data blocks. The snapshot manager can evaluate the blockdescriptors in the fingerprint database to determine the appropriateinode numbers to selectively evaluate the data map records. The snapshotmanager does not identify valid cached data blocks to expand ownershipof the data map records but, rather, to associate received snapshotswith the cached data blocks.

At block 1619, the snapshot manager updates the fingerprint database toassociate the received snapshot with valid cached data blocks. Thefingerprint database metadata will identify inode numbers and/or fileblock numbers that reference the cached data blocks. The fingerprintdatabase metadata can also indicate snapshots. The pairing of inodenumber and snapshot identifier can uniquely identify an instance of areferencing file. If a storage appliance does not implementdeduplication, the storage appliance can maintain a data structure withdescriptors for cached data blocks and indicate associated localsnapshot identifiers and file information (e.g., inode numbers, fileblock numbers, etc.).

At block 1621, the snapshot manager modifies eviction state data forvalid cached data blocks. The snapshot manager modifies the evictionstate data associated with the valid cached data blocks to reduce thechances of being evicted. The snapshot manager can modify the evictionstate data of the data blocks to indicate a time indicator (e.g., timestamp, time period identifier, etc.) associated with the receivedsnapshot. If the eviction policy is based on use frequency (e.g., leastfrequently used), the snapshot manager can increment the use counter.The snapshot manager may update multiple fields of eviction state datafor an eviction policy that has multiple factors, e.g., age and usefrequency.

At block 1623, the snapshot manager determines whether the precedingsnapshot is the baseline snapshot. If not, there are additionalpreceding incremental snapshots to process and control returns to block1605. If the baseline snapshot has been reached, then the process endsuntil the next snapshot is received.

FIGS. 17-20 depict a flowchart of example operations for creating areverse incremental based synthetic baseline snapshot to reduce stabledata eviction. Instead of expanding ownership of snapshot metadata, areverse incremental synthetic baseline snapshot is maintained. Incontrast to the example operations of FIG. 16, snapshot data istransferred between snapshots to the most recent snapshot to continually“refresh” the synthetic baseline snapshot with the most recent snapshot.

At block 1701 of FIG. 17, a snapshot manager detects a snapshot transferthat specifies a defined data collection and a snapshot. Anotherprocess, such as a process of a communication protocol stack,communicates information to the snapshot manager that a snapshot for adata collection is being transferred, for example in a stream, to thestorage appliance that hosts the snapshot manager. The snapshot transferinformation corresponds to an initial exchange between the hostingstorage appliance and a data source. This information at last identifiesthe defined data collection and the snapshot with a snapshot identifierrecognized by the data source (e.g., UUID).

At block 1703, the snapshot manager updates a data collection map toassociate the defined data collection and the specified snapshot. Thesnapshot manager can update data collection metadata, as previouslydescribed, that indicates snapshots received per defined datacollection.

At block 1705, the snapshot manager assigns a synthetic baselinesnapshot identifier to the snapshot and determines a key-value store forthe defined data collection. The snapshot manager can reserve a valuefor the synthetic baseline identifier or use a predefined value for thesynthetic baseline identifier. For example, the snapshot manager can usea maximum unsigned integer as the synthetic baseline snapshot identifierif local snapshot identifiers are unsigned integers. This can avoid adeterministic local snapshot identifier from incrementing to collidewith the synthetic baseline snapshot identifier.

At block 1707, the snapshot manager begins processing each detectedsnapshot component. These “components” can take different formsdepending on how the data source communicates a snapshot via stream. Asexamples, a component can be a request (e.g., request to perform adirectory operation), message, object, etc. As described earlier, thecomponent can indicate different types of snapshot metadata or snapshotdata.

At block 1709, the snapshot manager determines the type of snapshotcomponent. The snapshot manager can determine the type of snapshotcomponent by reading a flag or value in a body or header of thecomponent. If the snapshot stream component indicates snapshot data(e.g., a data block(s) and block descriptor), then control flows toblock 2001 as indicated by the letter G. If the snapshot streamcomponent indicates directory metadata, then control flows to block1901. If the snapshot component indicates inode metadata, then controlflows to block 1801.

At block 1801 of FIG. 18, the snapshot manager creates an inode recordin the previously determined key-value store with a key based on thesynthetic baseline snapshot identifier and the inode number indicated inthe snapshot stream component. Creation of the inode record can involvecreating a data structure that conforms to the design of the key-valuestore and populating value fields of the inode record with informationin the snapshot stream component (e.g., file attributes).

At block 1803, the snapshot manager determines whether the key isalready present in the key-value store. The snapshot manager can submita record retrieval with the created key. If a record is returned, thenthe corresponding inode record is no longer valid for the snapshot beingreceived. If no record is returned, then control flows to block 1807. Ifa record is returned, then control flows to block 1805.

At block 1805, the snapshot manager changes the inode record thatalready exists in the key-value store to use a pre-baseline snapshotidentifier as the key prefix. The pre-baseline snapshot identifiercomprises a local snapshot identifier that identifies the snapshot thatprecedes the currently received snapshot. The snapshot manager caninitialize the pre-baseline snapshot identifier to be a valuerepresenting a first received snapshot for a data collection (e.g., 0or 1) and increment the value after being used. Embodiments can alsowait to increment the pre-baseline identifier until a new snapshot isreceived. The snapshot manager can change the existing record bysubmitting an update or change request that conforms to the semantics ofthe key-value store. Effectively, the snapshot manager is effectivelycreating a pre-baseline snapshot as it is refreshing the syntheticbaseline snapshot. Control flows to block 1807.

At block 1807, the snapshot manager inserts the created inode recordinto the key-value store. The created inode record includes the inodemetadata of the snapshot being received and the synthetic baselineidentifier as the key-prefix. Control flows to block 1711 of FIG. 17.

If the snapshot manager determines at block 1709 that the snapshotcomponent indicates directory metadata, then control flows to block 1901of FIG. 19. Processing of directory metadata in FIG. 19 is similar toprocessing inode metadata in FIG. 18. At block 1901 of FIG. 19, thesnapshot manager creates a directory record in the previously determinedkey-value store with a key based on the synthetic baseline snapshotidentifier, a parent inode number indicated in the snapshot streamcomponent, and a child name indicated in the snapshot stream component.Creation of the directory record can involve creating a data structurethat conforms to the design of the key-value store and populating valuefields of the directory record with information in the snapshot streamcomponent (e.g., inode number corresponding to the child name, ownershipinformation, access permissions, etc.).

At block 1903, the snapshot manager determines whether the key isalready present in the key-value store. The snapshot manager can submita record retrieval with the created key. If a record is returned, thenthe corresponding directory record is no longer valid for the snapshotbeing received. If no record is returned, then control flows to block1907. If a record is returned, then control flows to block 1905. If akey-value store provides for an operation to indicate whether a keyexists in the key-value store without returning the correspondingrecord, then the snapshot manager can use that operation instead ofrecord retrieval to determine whether the created record, whether inodeor directory, invalidates a counterpart record in the key-value store.

At block 1905, the snapshot manager changes the directory record thatalready exists in the key-value store to use the pre-baseline snapshotidentifier as the key prefix. Control flows to block 1907.

At block 1907, the snapshot manager inserts the created inode recordinto the key-value store. The created inode record includes thedirectory metadata of the snapshot being received and the syntheticbaseline identifier as the key-prefix. Control flows to block 1711 ofFIG. 17.

If the snapshot manager determines at block 1709 that the snapshotcomponent indicates snapshot data (e.g., data blocks and blockdescriptors), then control flows to block 2001 of FIG. 20. Since thesynthetic baseline snapshot persists across snapshots, the snapshotmanager can maintain a corresponding snapshot data file. This syntheticbaseline snapshot data file changes with each received snapshot. Thesnapshot manager creates and closes the pre-baseline snapshot data filescreated from the update of the synthetic baseline snapshot. Accordingly,the snapshot manager transfers invalidated snapshot metadata andsnapshot data to the pre-baseline snapshot and incorporates thenew/changed data of the snapshot being received.

At block 2001, the snapshot manager uses the synthetic baseline snapshotidentifier and inode number indicated in the snapshot data component toretrieve data map records from the key-value store. In other words, thesnapshot manager retrieves those of the data map records currently ownedby the synthetic baseline snapshot that correspond to the inodenumber(s) indicated in the data component.

At block 2003, the snapshot manager determines whether the receivedsnapshot data indicates overwrite/change of any data block(s) that iscurrently owned by the synthetic baseline snapshot. To make thisdetermination, the snapshot manager evaluates the source file offset andlength of the received snapshot data against the source file offsets andlengths of the retrieved data map records. If an overwrite/change hasoccurred, then control flows to block 2011. Otherwise, control flows toblock 2005.

At block 2005, the snapshot manager appends the data in the snapshotdata component to the synthetic baseline snapshot data file. Thesnapshot manager records the offset at which the data was appended forwriting into a corresponding data map record.

At block 2007, the snapshot manager creates a data map record thatindicates a key based on the synthetic baseline identifier, an inodenumber indicated in the snapshot data component, and a source fileoffset indicated in the snapshot data component. The snapshot manageralso creates the data map record with value fields populated with thelength indicated in the snapshot data component and the recordedsynthetic baseline snapshot data file offset at which the data wasappended. At block 2009, the snapshot manager inserts the created datamap record. Control flows from block 2009 to block 1711 of FIG. 17.

If the snapshot manager determines that an overwrite/change occurred atblock 2003, then control flows to block 2011. At block 2011, thesnapshot manager begins to transfer each non-contiguous data range thatis overwritten/changed to the pre-baseline snapshot. The snapshotmanager can determine the non-contiguous range(s) of data to betransferred to the pre-baseline snapshot by comparing the source fileoffsets and lengths. Each non-contiguous range is referred to below forFIG. 20 as the range.

At block 2013, the snapshot manager copies data of the range from thesynthetic baseline snapshot data file to a pre-baseline snapshot datafile. If this is the first snapshot data component for the snapshotbeing received, then the snapshot manager can create or request creationof a snapshot data file with an identifier based on the pre-baselinesnapshot identifier (e.g., file name that incorporates the pre-baselinesnapshot identifier). The copying to the pre-baseline snapshot data filecan conform to the previously described append paradigm.

At block 2015, the snapshot manager creates a data map recordcorresponding to the range with the pre-baseline identifier as the keyprefix. The snapshot manager creates a data map record for thepre-baseline snapshot that uses the inode number, the source fileoffset, and the length from the synthetic baseline snapshot data maprecord. The snapshot manager indicates the offset at which the data wasappended into the pre-baseline snapshot data file.

At block 2017, the snapshot manager deletes the data of the range fromthe synthetic baseline snapshot data file. For example, the snapshotmanager can write null values, all zeroes, all ones, into the range ofthe synthetic baseline snapshot data file. The snapshot manager can markor track ranges that are deleted instead of deleting the range or beforedeleting the range.

At block 2019, the snapshot manager updates the data map record(s) ofthe synthetic baseline snapshot to remove the range. As describedearlier, an overwrite may be partial. If a partial overwrite isdetected, then the snapshot manager updates source file offsets andlengths depending upon whether the data range that remains valid for thecurrently received snapshot is a front range, back range, or both (i.e.,a data range was split).

At block 2021, the snapshot manager determines whether there is anadditional non-contiguous range that is overwritten. If not, controlcontinues to block 2005. Otherwise, the snapshot manager proceeds to thenext non-contiguous range to process at block 2011.

After the snapshot metadata and snapshot data updates described in FIGS.18-20, the flow returns to FIG. 17. At block 1711, the snapshot managerdetermines whether the end of the snapshot is detected. The snapshotmanager may receive a communication when a snapshot ends and begins, butmay not be informed when a session or connection is interrupted orrestarted. The snapshot manager may receive a termination command orclose command that signifies ending of the snapshot. If the end of thesnapshot has not been reached, then control flows back to block 1707.Otherwise, control flows to block 1713.

At block 1713, the snapshot manager updates the fingerprint database,assuming deduplication is implemented, to associate the syntheticbaseline snapshot identifier with the newly cached data. Data receivedfor the received snapshot is updated in metadata that tracks the cacheddata and is updated to indicate an association with the syntheticbaseline snapshot.

At block 1715, the snapshot manager updates a mapping of source snapshotidentifiers to local snapshot identifiers. The snapshot managerassociates the source snapshot identifier of the currently receivedsnapshot with the synthetic baseline snapshot identifier. The snapshotmanager changes the mapping of the previously received snapshot to beassociated with the pre-baseline snapshot identifier.

At block 1717, the snapshot manager updates the pre-baseline snapshotidentifier. For example, the snapshot manager increments thepre-baseline snapshot identifier.

At block 1719, the snapshot manager modifies eviction state data fortransferred cached data blocks. The snapshot manager modifies theeviction state data associated with the valid cached data blocks toreduce the chances of being evicted. The snapshot manager can modify theeviction state data to indicate a time indicator (e.g., time stamp, timeperiod identifier, etc.) associated with the received snapshot. If theeviction policy is based on use frequency (e.g., least frequently used),the snapshot manager can increment the use counter. The snapshot managermay update multiple fields of eviction state data for an eviction policythat has multiple factors, e.g., age and use frequency. Embodiments canuse the local snapshot identifiers as eviction state data. Since thelocal snapshot identifiers correspond to order of receipt of thesnapshots, the eviction mechanism can evict data blocks associated withlocal snapshot identifiers that suggest earliest receipt. Data used bythe synthetic baseline snapshot will maintain an association with thesynthetic baseline snapshot identifier, which represents to the evictionmechanism that it is most frequently used or most recently used,depending upon the caching algorithm being used.

Variations

The flowcharts are provided to aid in understanding the illustrationsand are not to be used to limit scope of the claims. The flowchartsdepict example operations that can vary within the scope of the claims.Additional operations may be performed; fewer operations may beperformed; the operations may be performed in parallel; and theoperations may be performed in a different order. For instance, FIGS.4-6 present example operations that restore a specified snapshot.Embodiments, however, can service multiple requests to concurrentlyrestore snapshots of different data collections. For example, theoperations can perform operations to spawn different threads fordifferent data collections and track progress of restores by datacollection thread. As another example variant, the operations of FIGS.4-6 can communicate valid data blocks as identified to a restore targetinstead of communicating valid data blocks after they have beenidentified for a snapshot. For instance, the operations to write validdata blocks into a buffer for communicating to a restore target (i.e.,blocks 605, 607, 609, 611, and 617) could be performed after identifyingthe valid ranges in 511 instead of updating a restore data map. It willbe understood that each block of the flowchart illustrations and/orblock diagrams, and combinations of blocks in the flowchartillustrations and/or block diagrams, can be implemented by program code.The program code may be provided to a processor of a general purposecomputer, special purpose computer, or other programmable machine orapparatus.

As will be appreciated, aspects of the disclosure may be embodied as asystem, method or program code/instructions stored in one or moremachine-readable media. Accordingly, aspects may take the form ofhardware, software (including firmware, resident software, micro-code,etc.), or a combination of software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”The functionality presented as individual modules/units in the exampleillustrations can be organized differently in accordance with any one ofplatform (operating system and/or hardware), application ecosystem,interfaces, programmer preferences, programming language, administratorpreferences, etc.

Any combination of one or more machine readable medium(s) may beutilized. The machine readable medium may be a machine readable signalmedium or a machine readable storage medium. A machine readable storagemedium may be, for example, but not limited to, a system, apparatus, ordevice, that employs any one of or combination of electronic, magnetic,optical, electromagnetic, infrared, or semiconductor technology to storeprogram code. More specific examples (a non-exhaustive list) of themachine readable storage medium would include the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a portable compact disc read-only memory (CD-ROM), anoptical storage device, a magnetic storage device, or any suitablecombination of the foregoing. In the context of this document, a machinereadable storage medium may be any tangible medium that can contain, orstore a program for use by or in connection with an instructionexecution system, apparatus, or device. A machine readable storagemedium is not a machine readable signal medium.

A machine readable signal medium may include a propagated data signalwith machine readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Amachine readable signal medium may be any machine readable medium thatis not a machine readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a machine readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, RF, etc., or any suitable combination ofthe foregoing.

Computer program code for carrying out operations for aspects of thedisclosure may be written in any combination of one or more programminglanguages, including an object oriented programming language such as theJava® programming language, C++ or the like; a dynamic programminglanguage such as Python; a scripting language such as Perl programminglanguage or PowerShell script language; and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on astandalone machine, may execute in a distributed manner across multiplemachines, and may execute on one machine while providing results and oraccepting input on another machine.

The program code/instructions may also be stored in a machine readablemedium that can direct a machine to function in a particular manner,such that the instructions stored in the machine readable medium producean article of manufacture including instructions which implement thefunction/act specified in the flowchart and/or block diagram block orblocks.

FIG. 21 depicts an example computer system with a storage appliancesnapshot manager. The computer system includes a processor 2101(possibly including multiple processors, multiple cores, multiple nodes,and/or implementing multi-threading, etc.). The computer system includesmemory 2107. The memory 2107 may be system memory (e.g., one or more ofcache, SRAM, DRAM, zero capacitor RAM, Twin Transistor RAM, eDRAM, EDORAM, DDR RAM, EEPROM, NRAM, RRAM, SONOS, PRAM, etc.) or any one or moreof the above already described possible realizations of machine-readablemedia. The computer system also includes a bus 2103 (e.g., PCI, ISA,PCI-Express, HyperTransport® bus, InfiniBand® bus, NuBus, etc.) and anetwork interface 2105 (e.g., a Fiber Channel interface, an Ethernetinterface, an internet small computer system interface, SONET interface,wireless interface, etc.). The system also includes a storage appliancesnapshot manager 2111. The storage appliance snapshot manager 2111 canbe configured with either or both of the snapshot layout/arrangementcreation and utilization functionality and the synthetic baselinesnapshot and eviction state refresh functionality described above. Anyone of the previously described functionalities may be partially (orentirely) implemented in hardware and/or on the processor 2101. Forexample, the functionality may be implemented with an applicationspecific integrated circuit, in logic implemented in the processor 2101,in a co-processor on a peripheral device or card, etc. Further,realizations may include fewer or additional components not illustratedin FIG. 21 (e.g., video cards, audio cards, additional networkinterfaces, peripheral devices, etc.). The processor 2101 and thenetwork interface 2105 are coupled to the bus 2103. Although illustratedas being coupled to the bus 2103, the memory 2107 may be coupled to theprocessor 2101.

While aspects of the disclosure are described with reference to variousimplementations and exploitations, it will be understood that theseaspects are illustrative and that the scope of the claims is not limitedto them. In general, techniques for arranging snapshot metadata andsnapshot data as described herein may be implemented with facilitiesconsistent with any hardware system or hardware systems. Manyvariations, modifications, additions, and improvements are possible.

Plural instances may be provided for components, operations orstructures described herein as a single instance. Finally, boundariesbetween various components, operations and data stores are somewhatarbitrary, and particular operations are illustrated in the context ofspecific illustrative configurations. Other allocations of functionalityare envisioned and may fall within the scope of the disclosure. Ingeneral, structures and functionality presented as separate componentsin the example configurations may be implemented as a combined structureor component. Similarly, structures and functionality presented as asingle component may be implemented as separate components. These andother variations, modifications, additions, and improvements may fallwithin the scope of the disclosure.

TERMINOLOGY

This description uses the term “stream” to refer to a unidirectionalstream of data flowing over a data connection between two entities in asession. The entities in the session may be interfaces, services, etc.The elements of the stream can vary in size and formatting dependingupon the entities communicating with the session. Although the streamelements will be segmented/divided according to the protocol supportingthe session, the entities may be handling the data at an operatingsystem perspective and the stream elements may be data blocks from thatoperating system perspective. The stream is a “stream” because a datacollection (e.g., a volume or directory) is serialized at the source forstreaming to a destination. Serialization of the stream elements allowsfor reconstruction of the data collection at a higher layer than that ofthe layer corresponding to the serialization.

Use of the phrase “at least one of” preceding a list with theconjunction “and” should not be treated as an exclusive list and shouldnot be construed as a list of categories with one item from eachcategory, unless specifically stated otherwise. A clause that recites“at least one of A, B, and C” can be infringed with only one of thelisted items, multiple of the listed items, and one or more of the itemsin the list and another item not listed.

What is claimed is:
 1. A method, comprising: deterministicallygenerating, by a computing device, an identifier as a key prefix forsnapshot metadata for each of a plurality of snapshots received for adata collection; inserting, by the computing device, a plurality of datamap records into a key-value store for the data collection, wherein eachof the data map records is keyed by the key prefix, one of a pluralityof inode numbers indicated in the snapshot metadata for one of thesnapshots, and a source file offset; storing, by the computing device,snapshot data comprising file data for a plurality of files associatedwith each of the snapshots into separate snapshot data files, whereinthe snapshot data files each comprise an aggregation of the file datafor the files associated with a corresponding one of the snapshots; andinserting, by the computing device, a snapshot data file offset as avalue in each of the data map records in the key-value store for each ofthe snapshots that maps a portion of the snapshot data of the snapshotto a location in a corresponding one of the snapshot data files.
 2. Themethod of claim 1, further comprising associating, by the computingdevice, a source snapshot identifier of each the snapshots with thedeterministically generated identifier of the snapshot, wherein thesource snapshot identifier is determined independently of thedeterministically generated identifiers.
 3. The method of claim 1,further comprising creating, by the computing device, for each of thesnapshots, and in the key-value store, an inode record for each of theinode numbers and a directory record for each of a plurality ofdirectories indicated in the snapshot metadata, wherein each of theinode records is keyed by the key prefix and another one of the inodenumbers and each of the directory records is keyed by the key prefix, aparent one of the inode numbers, and a child name.
 4. The method ofclaim 3, further comprising inserting, by the computing device, one ormore file attributes for at least one of the files as a value into eachof the inode records.
 5. The method of claim 1, further comprisingappending, by the computing device and for each of the snapshots, eachof one or more data blocks in the snapshot data of the snapshot into thedata file for the snapshot based on receipt of the data blocks from oneor more data sources.
 6. The method of claim 1, further comprisingretrieving, by the computing device and in response to a request torestore a first snapshot of the snapshots to a restore target, one ormore records from the key-value store using one of the deterministicallygenerated identifiers as a key prefix, wherein the request identifiesthe first snapshot with a source snapshot identifier and the sourcesnapshot identifier is determined independently of the deterministicallygenerated identifiers.
 7. A non-transitory machine-readable mediumhaving stored thereon instructions for improved snapshot management tofacilitate efficient cloud integrated operations in data storagenetworks comprising machine executable code that, when executed by atleast one machine, causes the machine to: deterministically generate anidentifier as a key prefix for snapshot metadata for each of a pluralityof snapshots received for a data collection; insert a plurality of datamap records into a key-value store for the data collection, wherein eachof the data map records is keyed by the key prefix, one of a pluralityof inode numbers indicated in the snapshot metadata for one of thesnapshots, and a source file offset; store snapshot data comprising filedata for a plurality of files associated with each of the snapshots intoseparate snapshot data files, wherein the snapshot data files eachcomprise an aggregation of the file data for the files associated with acorresponding one of the snapshots; and insert a snapshot data fileoffset as a value in each of the data map records in the key-value storefor each of the snapshots that maps a portion of the snapshot data ofthe snapshot to a location in a corresponding one of the snapshot datafiles.
 8. The non-transitory machine readable medium of claim 7, whereinthe machine executable code when executed by the machine further causesthe machine to associate a source snapshot identifier of each thesnapshots with the deterministically generated identifier of thesnapshot, wherein the source snapshot identifier is determinedindependently of the deterministically generated identifiers.
 9. Thenon-transitory machine readable medium of claim 7, wherein the machineexecutable code when executed by the machine further causes the machineto create, for each of the snapshots, and in the key-value store, aninode record for each of the inode numbers and a directory record foreach of one a plurality of directories indicated in the snapshotmetadata, wherein each of the inode records is keyed by the key prefixand another one of the inode numbers and each of the directory recordsis keyed by the key prefix, a parent one of the inode numbers, and achild name.
 10. The non-transitory machine readable medium of claim 9,wherein the machine executable code when executed by the machine furthercauses the machine to insert one or more file attributes for at leastone of the files as a value into each of the inode records.
 11. Thenon-transitory machine readable medium of claim 7, wherein the machineexecutable code when executed by the machine further causes the machineto append, for each of the snapshots, each of one or more data blocks inthe snapshot data of the snapshot into the data file for the snapshotbased on receipt of the data blocks from one or more data sources. 12.The non-transitory machine readable medium of claim 7, wherein themachine executable code when executed by the machine further causes themachine to retrieve, in response to a request to restore a firstsnapshot of the snapshots to a restore target, one or more records fromthe key-value store using one of the deterministically generatedidentifiers as a key prefix, wherein the request identifies the firstsnapshot with a source snapshot identifier and the source snapshotidentifier is determined independently of the deterministicallygenerated identifiers.
 13. A computing device, comprising: a memorycontaining a machine-readable medium comprising machine executable codehaving stored thereon instructions for improved snapshot management tofacilitate efficient cloud integrated operations in data storagenetworks; and a processor coupled to the memory, the processorconfigured to execute the machine executable code to cause the processorto: deterministically generate an identifier as a key prefix forsnapshot metadata for each of a plurality of snapshots received for adata collection; insert a plurality of data map records into a key-valuestore for the data collection, wherein each of the data map records iskeyed by the key prefix, one of a plurality of inode numbers indicatedin the snapshot metadata for one of the snapshots, and a source fileoffset; store snapshot data comprising file data for a plurality offiles associated with each of the snapshots into separate snapshot datafiles, wherein the snapshot data files each comprise an aggregation ofthe file data for the files associated with a corresponding one of thesnapshots; and insert a snapshot data file offset as a value in each ofthe data map records in the key-value store for each of the snapshotsthat maps a portion of the snapshot data of the snapshot to a locationin a corresponding one of the snapshot data files.
 14. The computingdevice of claim 13, wherein the processor is further configured toexecute the machine executable code to associate a source snapshotidentifier of each the snapshots with the deterministically generatedidentifier of the snapshot, wherein the source snapshot identifier isdetermined independently of the deterministically generated identifiers.15. The computing device of claim 13, wherein the processor is furtherconfigured to execute the machine executable code to create, for each ofthe snapshots, and in the key-value store, an inode record for each ofthe inode numbers and a directory record for each of a plurality ofdirectories indicated in the snapshot metadata, wherein each of theinode records is keyed by the key prefix and another one of the inodenumbers and each of the directory records is keyed by the key prefix, aparent one of the inode numbers, and a child name.
 16. The computingdevice of claim 15, wherein the processor is further configured toexecute the machine executable code to insert one or more fileattributes for at least one of the files as a value into each of theinode records.
 17. The computing device of claim 13, wherein theprocessor is further configured to execute the machine executable codeto append, for each of the snapshots, each of one or more data blocks inthe snapshot data of the snapshot into the data file for the snapshotbased on receipt of the data blocks from one or more data sources. 18.The computing device of claim 13, wherein the processor is furtherconfigured to execute the machine executable code to retrieve, inresponse to a request to restore a first snapshot of the snapshots to arestore target, one or more records from the key-value store using oneof the deterministically generated identifiers as a key prefix, whereinthe request identifies the first snapshot with a source snapshotidentifier and the source snapshot identifier is determinedindependently of the deterministically generated identifiers.
 19. Thecomputing device of claim 15, wherein the child name comprises a name ofone of the files or another name of one of the directories.
 20. Thecomputing device of claim 15, wherein the processor is furtherconfigured to execute the machine executable code to insert anadditional one of the inode numbers corresponding to the child name as avalue into each of the directory records.